{% extends "layouts/application.html" %}
{% block content %}

<div align="center">
  <DIV class=boxright>
    <DIV class=bltop2>
      <div align="left">&nbsp;&nbsp;&nbsp;
        <strong>
          当前位置：&nbsp;&nbsp;
          <a href="{{obj.get_top_url}}">资料库</a>
          <img src="/site_media/image/zd_arrow.gif">&nbsp;&nbsp;
          <a href="/resource/show_leveltwo_resource/{{obj.parentId.id}}">{{obj.parentId.name}}</a>
          <img src="/site_media/image/zd_arrow.gif">&nbsp;&nbsp;
          <a href="{{obj.get_second_url}}">{{obj}}</a>
        </strong>
      </div>
    </DIV>
    <DIV class=c_box>
      <DIV class="rep_left">
        <div class="bltop2"><span onclick="hideOrShowDiv('upfile_div')" class="s_left">上传文件</span></div>
        <form action="#" enctype="multipart/form-data" method="post">
        <div id="upfile_div">
          <TABLE id=tblSearch  cellSpacing=0 cellPadding=4  width="100%" border=0>
            <TBODY>
              <TR>
                <TD class=rep_li_c2 width="18%">文件标题</TD>
                <TD class=rep_li_c2  COLSPAN="5" ALIGN="left">
                  <input class="text" name="name" size="30" style="WIDTH: 330px" type="text" />
                  {{form.name.errors}}
                </TD>
              </TR>

              <TR>
                <TD class=rep_li_c2 width="18%">选择文件</TD>
                <TD class=rep_li_c2  COLSPAN="5" ALIGN="left">
                  <input type="file" class="text"></input>
                  {{form.file.errors}}
                </TD>
              </TR>
              <tr>

              </tr>
              <TR>
                <TD class=rep_li_c2 colSpan=6>
                  <INPUT onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'" class=submit id="" type=submit value=上传 name="">
                  <INPUT onMouseOver="this.className='reset2'" onMouseOut="this.className='reset'" id="reset_load" class="reset"  type="reset" value=取消>
                </TD>
              </TR>
            </TBODY>
          </TABLE>
        </div>
        </form>
          <TABLE id=show_tab class=tatop7px cellSpacing=0 cellPadding=4 width="100%" border=0>
            <THEAD>
              <TR ALIGN="center">
                <TH class=rTHw width="4%">
                <INPUT id="chkAll" onclick="title_check('chkAll','chkID[]')"  type=checkbox value=checkbox></TH>
                <TH class=rep_li_c width="17%"><STRONG>文件名</STRONG></TH>
                <TH class=rep_li_c width="10%"><STRONG>上传人</STRONG></TH>
                <TH class=rep_li_c width="10%"><STRONG>大小</STRONG></TH>
                <TH class=rep_li_c width="16%"><STRONG>创建日期</STRONG></TH>
                <TH class=rep_li_c width="8%"><STRONG>&nbsp;</STRONG></TH>
              </TR>
            </THEAD>
            <TBODY>
              {#asd#}
                <TR id="tr_<%=file.id%>" style="TEXT-DECORATION: none" onMouseOver="this.style.backgroundColor='#EFF8FF'" onmouseout="this.style.backgroundColor=''">
                  <TD class=rtdw2>
                    <INPUT onclick="rows_check('chkAll','chkID[]')" type=checkbox value="<%=file.id%>" name="chkID[]">
                  </TD>
                  <TD class=rep_li_td_bt ALIGN="center" >
                    <%=file.file_name%>
                  </TD>
                  <TD class=rep_li_td_bt><%=file.creater.login_name%></TD>
                  <TD class=rep_li_td_bt><%=trunc_size(file.file_size)%>(M)</TD>
                  <TD class=rep_li_td_bt><%=file.created_strf_date%></TD>
                  <TD class=rep_li_td_bt>
                    <a href="<%=$down_load_path%>/<%=file.folder_date%>/<%=file.alias_filename%>" target="_blank">下载</a>
                  </TD>
                </TR>
              <%end%>
            </TBODY>
          </TABLE>

          <TABLE class=tatop7px cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR>
                <TD  align="center">
                  <%=will_paginate @files%>
                </TD>
              </TR>
            </TBODY>
          </TABLE>

          <TABLE cellSpacing=0 cellPadding=4 width="100%" border=0>
            <TBODY>
              <TR vAlign=top>
              <TR vAlign=top ALIGN="left">
                <TD>
                  <INPUT onclick="return check_select_one('chkAll','chkID[]')"
                         name="button" class="button" id="edit"  type="submit" value="编辑文件">
                  <INPUT ONCLICK="return check_select('chkID[]');"
                         name="button" class="button" id="destroy"  type="submit" value="彻底删除">
                </TD>
              </TR>
            </TBODY>
          </TABLE>
        <%end%>
      </DIV>
    </DIV>

    <!--上传文件时将背景变为不可编辑，并给出提示框-->
    <style type="text/css">
      a{ color:#000; font-size:12px;text-decoration:none}
      a:hover{ color:#900; text-decoration:underline}

      #massage_box{ position:absolute; left:expression((body.clientWidth-350)/2); top:expression((body.clientHeight-200)/2); width:350px; height:200px;filter:dropshadow(color=#666666,offx=3,offy=3,positive=2); z-index:2; visibility:hidden}
      #mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#666; filter:ALPHA(opacity=60); z-index:1; visibility:hidden}
      .massage{border:#036 solid; border-width:1 1 3 1; width:95%; height:95%; background:#fff; color:#036; font-size:12px; line-height:150%}
      .header{background:#036; height:10%; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; padding:3 5 0 5; color:#fff}
    </style>
    <div id="massage_box">
      <div class="massage">
        <div class="header">
          <div style="display:inline; width:150px; position:absolute">友情提示</div>
        <span  style="float:right; display:inline; cursor:hand"></span></div>
        <ul style="margin-right:25">
          <table width="244" height="118" border="0">
            <tr>
              <td height="38" colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td width="47" height="38"><img src="/images/loading_1.gif"/></td>
              <td width="181" align="center"><font color="#000066" style="font-size:12px;">文件上传中，请稍后……</font></td>
            </tr>
            <tr>
              <td height="32" colspan="2">&nbsp;</td>
            </tr>
          </table>
        </ul>
      </div>
    </div>
    <div id="mask"></div>
    <!--=======================================================-->

    <SCRIPT type="text/javascript">
       new TableSorter("show_tab", 1, 2, 3, 4, 5, 6, 7);
    </SCRIPT>
  </DIV>
  <div>
  </div>
</div>
{% endblock %}
